package com.gitee.zycra.future.job.common.model;

import com.gitee.zycra.jdbc.annotation.Column;
import com.gitee.zycra.jdbc.annotation.ID;
import com.gitee.zycra.jdbc.annotation.Table;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * @author zycra
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
@Table("job_running")
public class JobRunning {

    /**
     * 主键
     */
    @ID
    @Column("id")
    private Long id;

    /**
     * 任务名称
     */
    @Column("job_name")
    private String jobName;

    /**
     * 调度名称
     */
    @Column("schedule_name")
    private String scheduleName;

    /**
     * 任务类名
     */
    @Column("job_class_name")
    private String jobClassName;

    /**
     * 任务调度ID
     */
    @Column("job_schedule_id")
    private Long jobScheduleId;

    /**
     * 应用名称
     */
    @Column("application_name")
    private String applicationName;

    /**
     * 节点IP
     */
    @Column("node_ip")
    private String nodeIp;

    /**
     * 执行参数
     */
    @Column("schedule_param")
    private String scheduleParam;

    /**
     * 发起时间
     */
    @Column("schedule_time")
    private LocalDateTime scheduleTime;

    /**
     * 正常发起时间
     */
    @Column("normal_schedule_time")
    private LocalDateTime normalScheduleTime;

    /**
     * 重试次数
     */
    @Column("retry_times")
    private Integer retryTimes;

    /**
     * 任务进度
     *
     * @see com.gitee.zycra.future.job.common.enums.ScheduleRatioEnum
     */
    @Column("schedule_ratio")
    private Integer scheduleRatio;

    /**
     * 结束时间
     */
    @Column("complete_time")
    private LocalDateTime completeTime;

    /**
     * 超时时间
     */
    @Column("timeout_time")
    private LocalDateTime timeoutTime;

    /**
     * 创建时间
     */
    @Column("create_time")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @Column("update_time")
    private LocalDateTime updateTime;
}
